<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button class="but">登录</button>
    <input type="text" >

    <script>
        var button = document.querySelector('.but');
        var inp = document.querySelector('input');

        button.onclick = function(){
            //通过属性disabled设置按钮禁止
            button.disabled = true;
            inp.value = '禁用';
        }
    </script>
</body>
</html>